package com.education.welco.service;

import com.education.common.pojo.AjaxResult;
import com.education.welco.pojo.SAnsweringComment;
import com.education.welco.pojo.vo.MessageList;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * (答疑讨论) 服务层
 *
 * @author d
 * @date 2022-06-20
 */
public interface ISAnsweringCommentService {

    /**
     * 查询(答疑讨论)信息
     *
     * @param cPlId (答疑讨论)ID
     * @return (答疑讨论)信息
     */
    @GetMapping("selectSAnsweringCommentById")
    public SAnsweringComment selectSAnsweringCommentById(@RequestParam("cPlId") Integer cPlId);

    /**
     * 查询(答疑讨论)列表
     *
     * @param sAnsweringComment (答疑讨论)信息
     * @return (答疑讨论)集合
     */
    @PostMapping("selectSAnsweringCommentList")
    public List<SAnsweringComment> selectSAnsweringCommentList(@RequestBody SAnsweringComment sAnsweringComment);

    /**
     * 新增(答疑讨论)
     *
     * @param sAnsweringComment (答疑讨论)信息
     * @return 结果
     */
    @PostMapping("insertSAnsweringComment")
    public int insertSAnsweringComment(@RequestBody SAnsweringComment sAnsweringComment);

    /**
     * 修改(答疑讨论)
     *
     * @param sAnsweringComment (答疑讨论)信息
     * @return 结果
     */
    @PostMapping("updateSAnsweringComment")
    public int updateSAnsweringComment(@RequestBody SAnsweringComment sAnsweringComment);

    /**
     * 删除(答疑讨论)信息
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @GetMapping("deleteSAnsweringCommentByIds")
    public int deleteSAnsweringCommentByIds(@RequestParam("ids") String ids);

    /**
     * 查找答疑详情评论   (评论)    最新OR热门
     * @param answerId  答疑id
     * @param userId    用户id
     * @param type      最热or最新- 1为最新2为最热
     * @return
     */
    AjaxResult selectCommentListById(String answerId, String userId, String type);

    AjaxResult selectCommentListById2(String answerId, String userId, String type);

    int postComment(String userId, String name, String image, String resId, String text, String level);

    List<MessageList> selectCommentListBySAnswerId(List<Integer> twoIntList);


    public  int stickSAnsweringComment(Integer cPostId, Integer cPlId);

    SAnsweringComment selectCommentListByResId(Integer resId);

    //搜索每个答疑的讨论人数量
    List<Integer> countEachAnswerTalkPeopleNum(Integer id);

    //搜索每个答疑的讨论数量
    Integer countEachAnswerTalkNum(Integer id);

    //置顶|取消置顶(答疑讨论)
    Integer stickSAnsweringCommentForTeacher(Integer cPlId, Integer stick);
}